package java_IfAndSwitch.demo2;

/**
 * switch如何匹配枚举类
 */
public class Test02 {
    public static void main(String[] args) {
        whatDay(Day.MONDAY);
        whatSort(SortTemp.PENDING);
    }

    public static void whatDay(Day day){
        switch (day){
            case MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY:
                System.out.println("工作日");
                break;
            case SATURDAY, SUNDAY:
                System.out.println("休息日");
                break;
        }
    }

    public static void whatSort(SortTemp sort){
        switch (sort){
            case PENDING, ACTIVE, COMPLETED:
                System.out.println("正常");
                break;
            case CANCELLED:
                System.out.println("取消");
                break;
        }
    }
}
